<template>
  <div class="answer bg">
    <h3 v-html="msg" />
    <p class="note">答对{{num}}题</p>
    <div class="out">
      <van-button style="margin-top:calc(54rem/75)" type="danger" @click="out">退出</van-button>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'answer',
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['passed', 'num']),
    msg() {
      return this.passed
        ? '恭喜您通过本次考试！'
        : '非常抱歉,您未通过考试！<br />请及时与您督导联系<br />以便统一安排面授课程<br />谢谢！'
    }
  },
  created() {
    this.$store.commit('SET_ANSWER', true)
  },
  methods: {
    out() {
      this.$router.push('/list')
    }
  }
}
</script>

<style lang="stylus">
.answer
  padding 265px 0 103px

  h3
    font-size 40px
    text-align center

  .note
    margin-top 45px
    font-size 24px
    text-align center

  .out
    margin-top 103px
    text-align center
</style>
